﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<ChungNhanSinhVien.Entities.YeuCau>>" %>
<%using (Html.BeginForm())
  {      
%>
<table cellspacing="0" cellpadding="2" style="width: 100%; border: thin outset">
    <tr style="border: medium outset; background-color: #3B5998; font-weight: bold; color: White"
        align="center">
        <td style="border: medium outset;">
            Mã yêu cầu
        </td>
        <td style="border: medium outset;">
            Mã sinh viên
        </td>
        <td style="border: medium outset;">
            Loại chứng nhận
        </td>
        <td style="border: medium outset;">
            Tên chứng nhận
        </td>
        <td style="border: medium outset;">
            Thời điểm yêu cầu
        </td>
        <td style="border: medium outset;">
            Trạng thái
        </td>
    </tr>
    <%if (Model != null)
      {
          foreach (var item in Model)
          {
              if (item.ChungNhanID != null && item.ChungNhan.LoaiChungNhanID != null)
              {
                  if (Model.ToList().IndexOf(item) % 2 == 1)
              {%>
    <tr style="background-color: #B8CCE4">
        <td style="border: medium outset;" align=center>
            <%:item.ID%>
        </td>
        <td style="border: medium outset;" align=center>
            <%:item.StudentID%>
        </td>
        <td style="border: medium outset;">
            <%: 
            
                "(" + item.ChungNhan.LoaiChungNhanID + ") " + item.ChungNhan.LoaiChungNhan.TenLoaiChungNhan
                
            %>
        </td>
        <td style="border: medium outset;">
            <%: "(" + item.ChungNhanID + ") " + item.ChungNhan.TenChungNhan%>
        </td>
        <td style="border: thin outset;">
            <%: String.Format("{0:dd-MM-yyyy hh:mm tt}", item.ThoiDiemYeuCau.Value)%>
        </td>
        <td style="border: medium outset;">
            <%: item.TrangThai%>
        </td>
    </tr>
    <%
              }
                  else
              {%>
    <tr style="background-color: #DCE6F1">
        <td style="border: medium outset;" align=center>
            <%:item.ID%>
        </td>
        <td style="border: medium outset;" align=center>
            <%:item.StudentID%>
        </td>
        <td style="border: medium outset;">
            <%: 
            
                "(" + item.ChungNhan.LoaiChungNhanID + ") " + item.ChungNhan.LoaiChungNhan.TenLoaiChungNhan
                
            %>
        </td>
        <td style="border: medium outset;">
            <%: "(" + item.ChungNhanID + ") " + item.ChungNhan.TenChungNhan%>
        </td>
        <td style="border: medium outset;">
            <%: String.Format("{0:dd-MM-yyyy hh:mm tt}", item.ThoiDiemYeuCau.Value)%>
        </td>
        <td style="border: medium outset;">
            <%: item.TrangThai%>
        </td>
    </tr>
    <%
              }    
    
   
        }
          }
      } %>
</table>
<%} %>